
@extends('admin.layouts.app')
@section('content')
<div class="page-header">
        <h3 class="page-title">
            友链管理
        </h3>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="{{route('admin.friend.index')}}">友链管理</a></li>
                <li class="breadcrumb-item active" aria-current="page">添加友链</li>
            </ol>
        </nav>
    </div>
    <div class="row">
        <div class="col-md-12 grid-margin stretch-card">
            <div class="card">
                <div class="card-body">
                    <form class="forms-sample" action="{{route('admin.friend.update',$link->id)}}" method="post" enctype="multipart/form-data">
                        @csrf
                        @method('PUT')
                        {!! $errors->create->first('title','<div class="alert alert-danger col-md-12 grid-margin stretch-card">:message</div>') !!}
                        <div class="form-group">
                            <label for="title">名称</label>
                            <input type="text" name="title" value="{{ $link->title }}" class="form-control" id="title" placeholder="请输入名称">
                        </div>
                        {!! $errors->create->first('url','<div class="alert alert-danger col-md-12 grid-margin stretch-card">:message</div>') !!}
                        <div class="form-group">
                            <label for="url">网址</label>
                            <input type="text" name="url" value="{{ $link->url }}" class="form-control" id="url" placeholder="请输入网址">
                        </div>
                        {!! $errors->create->first('key','<div class="alert alert-danger col-md-12 grid-margin stretch-card">:message</div>') !!}
                        <div class="form-group">
                            <label for="key">关键字</label>
                            <input type="text" name="key" value="{{ $link->key }}" class="form-control" id="key" placeholder="请输入关键字">
                        </div>
                        {!! $errors->create->first('sort','<div class="alert alert-danger col-md-12 grid-margin stretch-card">:message</div>') !!}

                        <div class="form-group">
                            <label for="sort">排序</label>
                            <input type="text" name="sort" value="{{ $link->sort }}" class="form-control" id="sort">
                        </div>
                        <button type="submit" class="btn btn-gradient-primary mr-2">保存</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
